package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class Department {
    private Long id;

    private String name;

    private String sn;

    public String toJsonMsg(){
        Map map = new HashMap();
        map.put("id" ,id);
        map.put("name" ,name);
        map.put("sn" ,sn);
        //使用JSON 把map转换为 json对象传递过去
        return JSON.toJSONString(map);
    }

}